        <script type="text/javascript">

		// When the document is ready, initialize the link so
		// that when it is clicked, the printable area of the
		// page will print.
		$(function(){

				// Hook up the print link.
				$( ".print" ).attr( "href", "javascript:void( 0 )" )
					.click(
						function(){
							// Print the DIV.
							window.print();

							// Cancel click event.
							return( false );
						}
						)
				;

			}
			);
		$(function(){

				// Hook up the print link.
				$( ".email" ).attr( "href", "javascript:void( 0 )" )
					.click(
						function(){
							// Print the DIV.
							$( "#cmsoverlay" ).show("slow");
							$( "#cmsbox" ).show("slow");

							// Cancel click event.
							return( false );
						}
						)
				;

			}
			);
                         $(function() {
        $('.image_list li a').lightBox({
		overlayBgColor: '#82b481'
		});

    });
$(document).ready(function() {
     $('#top_manager').innerfade({
                    animationtype: 'slide',
                    speed: 750,
                    timeout: 7500,
                    type: 'random',
                    containerheight: '100px'
                });

<?php if($pageRes->imagesNum>1) { ?>


				//rotation speed and timer
				var speed = 7000;
				var run = setInterval('rotate()', speed);

				//grab the width and calculate left value
				var item_width = $('.image_list li').outerWidth();
				var left_value = item_width * (-1);

				//move the last item before first item, just in case user click prev button
				$('.image_list li:first').before($('.image_list li:last'));

				//set the default item to the correct position
				$('.image_list ul').css({'left' : left_value});

				//if user clicked on prev button
				$('#prev').click(function() {

					//get the right position
					var left_indent = parseInt($('.image_list ul').css('left')) + item_width;

					//slide the item
					$('.image_list ul:not(:animated)').animate({'left' : left_indent}, 200,function(){

						//move the last item and put it as first item
						$('.image_list li:first').before($('.image_list li:last'));

						//set the default item to correct position
						$('.image_list ul').css({'left' : left_value});

					});

					//cancel the link behavior
					return false;

				});

				//if user clicked on next button
				$('#next').click(function() {

					//get the right position
					var left_indent = parseInt($('.image_list ul').css('left')) - item_width;

					//slide the item
					$('.image_list ul:not(:animated)').animate({'left' : left_indent}, 200, function () {

						//move the first item and put it as last item
						$('.image_list li:last').after($('.image_list li:first'));

						//set the default item to correct position
						$('.image_list ul').css({'left' : left_value});

					});

					//cancel the link behavior
					return false;

				});

				//if mouse hover, pause the auto rotation, otherwise rotate it
				$(".image_list").hover(

					function() {
						clearInterval(run);
					},
					function() {
						run = setInterval('rotate()', speed);
					}
				);

			
			//a simple function to click next link
			//a timer will call this function, and the rotation will begin :)
			

<?php } ?>});
    <?php  if($pageRes->imagesNum>1) {?>
        function rotate() {
				$(".image_list #next").click();
			}
        <?php }?>
	</script>